package com.ww.sentinel.client;

import com.ww.sentinel.client.UserClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @ClassName:
 * @author:
 * @Description:
 * @Date
 **/
@Component
public class UserFallback implements FallbackFactory<UserClient> {
    public UserClient create(Throwable throwable) {
        return new UserClient() {
            public String findAllUser() {
                return "找不到所有用户";
            }

            public String findUserById() {
                return "找不到单个用户";
            }

            public String add() {
                return "插入用户失败了";
            }
        };
    }
}
